package engine.render;

import engine.util.SoundUtil;
import static org.lwjgl.openal.AL10.*;
import org.lwjgl.util.WaveData;

public class SoundBuffer
{
    
    private int soundBufferID;
    //<editor-fold defaultstate="collapsed" desc="getSoundBufferID">
    public int getSoundBufferID()
    {
        return this.soundBufferID;
    }
    //</editor-fold>
    
    public SoundBuffer(String filename)
    {
        WaveData soundData = SoundUtil.get().loadSoundWAV(filename);
        this.soundBufferID = SoundUtil.get().genALSoundBuffer(soundData);
    }
    
    public void destroy()
    {
        alDeleteBuffers(this.soundBufferID);
        this.soundBufferID = -1;
    }
    
}
